package com.mail.portal.modular.service.impl;

import com.mail.portal.core.aop.PageHelper;
import com.mail.portal.modular.mapper.NewsMapper;
import com.mail.portal.modular.model.News;
import com.mail.portal.modular.service.INewsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 创建人： Shi Heng
 * 创建时间：2018-04-09 16:27
 * QQ：374696376
 * Description：
 */
@Service
public class NewsServiceImpl implements INewsService {

    @Resource
    NewsMapper newsMapper;


    @Override
    public News selectByPrimaryKey(Object id) {
        return newsMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<News> selectAll() {
        return newsMapper.selectAll();
    }

    @Override
    public List<News> selectAll(Integer page,Integer rows) {
        // 开始分页
        PageHelper.startPage(page,rows);
        return newsMapper.selectAll();
    }


    @Override
    public List<Map<String, Object>> list(String conditiion) {
        return newsMapper.list(conditiion);
    }

    @Override
    public List<News> queryByCategory(String category) {
        return newsMapper.queryByCategory(category);
    }

}
